package me.sunpeng.design.prototype.improve;

/**
 * @author sp
 */
public class Client {
    public static void main(String[] args) {
        System.out.println("原型模式完成对象的创建");

        Sheep sheep = new Sheep("tom", 1, "白色");
        sheep.friend = new Sheep("jack", 2, "黑色");
        //克隆
        Sheep cloneSheep = (Sheep) sheep.clone();
        System.out.println("输出原型 " + sheep + " firend " + sheep.friend.hashCode());
        System.out.println("输出克隆 " + cloneSheep + " firend " +cloneSheep.friend.hashCode());
    }
}
